package com.jt.www.admin.stats.controller;

import com.jt.www.admin.stats.service.InsureStatsService;
import com.jt.www.model.reps.ResultDTO;
import com.jt.www.model.vo.stats.businessyony.BusinessYonYParamVO;
import com.jt.www.model.vo.stats.educompleterate.EduCompleteRateParamVO;
import com.jt.www.model.vo.stats.edurevenue.EduRevenueParamVO;
import com.jt.www.model.vo.stats.jbwcuspay.JbwCusPayParamVO;
import com.jt.www.model.vo.stats.tbfjx.TbfjxParamVO;
import com.jt.www.model.vo.stats.tbmaster.TbmasterInsVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author admin_ltf
 * @create 2019-05-13 09:28
 */
@Api(value = "投保数据统计接口", tags = {"INSURE-STATS-API"}, description = "投保数据统计接口")
@RestController
@RequestMapping(value = "/stats/insure")
public class InsureStatsController {
    public static final Logger log = LoggerFactory.getLogger(InsureStatsController.class);
    @Autowired
    private InsureStatsService insureStatsService;

    //    业务同比情况表  BusinessYonYParamVO  BusinessYonYResultVO
    @ApiOperation(value = "业务同比情况表", notes = "业务同比情况表", httpMethod = "POST")
    @PostMapping(value = "/getBusinessYonYInfo")
    public ResultDTO<Map<String, Object>> searchBusinessYonYInfo(@RequestBody BusinessYonYParamVO vo) {


        ResultDTO resultMap = insureStatsService.searchBusinessYonYInfo(vo);


        return resultMap;
    }

//    统保示范项目业务统计表

    /**
     * 统保示范项目业务统计表
     *
     * @param tbmasterInsVO
     * @return
     */
    @ApiOperation(value = "统保示范项目业务统计表", notes = "统保示范项目业务统计表", httpMethod = "POST")
    @PostMapping(value = "/getTbsfInfo")
    public ResultDTO<Map<String, Object>> searchTbsfInfo(@ApiParam(value = "条件参数json", required = true) @RequestBody TbmasterInsVO tbmasterInsVO) {


        ResultDTO resultMap = insureStatsService.searchInfoByExample(tbmasterInsVO);


        return resultMap;
    }

// 统保附加险投保率统计

    /**
     * 统保附加险投保率统计
     *
     * @param tbfjxParamVO
     * @return
     */
    @ApiOperation(value = "统保附加险投保率统计", notes = "统保附加险投保率统计", httpMethod = "POST")
    @PostMapping(value = "/getTbfjx")
    public ResultDTO<Map<String, Object>> searchTbfjxByExample(@ApiParam(value = "条件参数json", required = true) @RequestBody TbfjxParamVO tbfjxParamVO) {


        ResultDTO resultMap = insureStatsService.searchTbfjxByExample(tbfjxParamVO);


        return resultMap;
    }

    // 教保网客户赔付率查询
//    教保网客户赔付率查询  。
    @ApiOperation(value = "教保网客户赔付率查询", notes = "教保网客户赔付率查询", httpMethod = "POST")
    @PostMapping(value = "/getJbwCusPay")
    public ResultDTO<Map<String, Object>> searchJbwCusPay(@RequestBody JbwCusPayParamVO vo) {


        ResultDTO resultMap = insureStatsService.searchJbwCusPay(vo);


        return resultMap;
    }

    // 教育渠道收入及结算率统计  EduRevenueParamVO  EduRevenueResultVO
    @ApiOperation(value = "教育渠道收入及结算率统计", notes = "教育渠道收入及结算率统计", httpMethod = "POST")
    @PostMapping(value = "/getEduRevenue")
    public ResultDTO<Map<String, Object>> searchEduRevenue(@RequestBody EduRevenueParamVO vo) {


        ResultDTO resultMap = insureStatsService.searchEduRevenue(vo);


        return resultMap;
    }

//    教育渠道指标完成率统计及同期对比 EduCompleteRateParamVO  EduCompleteRateResultVO

    @ApiOperation(value = "教育渠道指标完成率统计及同期对比", notes = "教育渠道指标完成率统计及同期对比", httpMethod = "POST")
    @PostMapping(value = "/getEduCompleteRate")
    public ResultDTO<Map<String, Object>> searchEduCompleteRate(@RequestBody EduCompleteRateParamVO vo) {


        ResultDTO resultMap = insureStatsService.searchEduCompleteRate(vo);


        return resultMap;
    }


//    /**
//     * 教保网满期保费查询
//     * @param vo
//     * @return
//     */
//    @ApiOperation(value = "教保网满期保费查询",notes = "教保网满期保费查询",httpMethod = "POST")
//    @PostMapping(value = "/getJbwExpireFee")
//    public ResultDTO<Map<String,Object>> searchJbwExpireFee(@ApiParam(value = "条件参数json", required = true) @RequestBody JbwExpireFeeParamVO vo) {
//
//
//        ResultDTO resultMap = insureStatsService.searchJbwExpireFee(vo);
//
//
//        return resultMap;
//    }
//
//    /**
//     * 安责险保险期间类型统计及同期对比
//     * @param vo
//     * @return
//     */
//    @ApiOperation(value = "安责险保险期间类型统计及同期对比",notes = "安责险保险期间类型统计及同期对比",httpMethod = "POST")
//    @PostMapping(value = "/getAzxStatsInfo")
//    public ResultDTO<Map<String,Object>> searchAzxStatsInfo(@ApiParam(value = "条件参数json", required = true) @RequestBody AzxStatsParamVO vo) {
//
//        ResultDTO resultMap = insureStatsService.searchAzxStatsInfo(vo);
//        return resultMap;
//    }

}
